echo Copyright (c) 2005 Bart Lagerweij. All rights reserved.
echo This program is free software. Use and/or distribute it under
echo the terms of the Nu2 License.
echo.
setlocal
set _format=
set _target=
set _base=%~dp0
if "%1" == "-f" set _format=1& shift
set _target=%~d1
if "%_target%" == "" (
echo Usage pe2usb [-f] ^<drive:^>
echo.
echo Where:
echo ^<drive:^> The drive letter of your USB flash drive
echo -f Format USB drive and install patched bootsector
echo ^(this is only needed the first time^)
goto _err)
echo USB target drive set to "%_target%"
echo Checking drive "%_target%"
if not exist %_target%\nul (
echo Error: Drive "%_target%" does not exist!
goto _err)
if "%_target%" == "%SystemDrive%" (
echo Error: Trying to install to your SystemDrive?!?
goto _err)
echo Checking files...
for %%i in ("%_base%plugin\peinst\mkbt.exe" "%_base%pe2usb.bin" "%_base%BartPE\i386\setupldr.bin" "%_base%mkisofs.exe" "%_base%srsp1\ramdisk.sys" "%_base%srsp1\setupldr.bin" "%_base%BartPE\bootsect.bin") do if not exist %%i (